﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:l="clr-namespace:LanderWpf"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="LanderWpf.MainWindow"
        Title="Lander" Height="680" Width="541"
        x:Name="LanderWindow"
        Loaded="LanderWindow_Loaded">
    
    <Window.Resources>
        <BitmapImage x:Key="SmoothImg" UriSource="smooth.png" />
        <BitmapImage x:Key="RockImg" UriSource="rock.png" />
    </Window.Resources>
    
    <Grid x:Name="Root">
        <Grid x:Name="Controls" HorizontalAlignment="Left" Width="170.333" Margin="6,8,0,8">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="80" />
                <ColumnDefinition Width="40" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="320*" />
            </Grid.RowDefinitions>
            
            <TextBlock Text="Pitch"           Grid.Row="0" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Pitch}" Grid.Row="0" Grid.Column="1" FontSize="16" Margin="0,0,3,0" />
            <Button x:Name="PitchUp"   Content="+" Click="PitchUp_Click"   Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            <Button x:Name="PitchDown" Content="-" Click="PitchDown_Click" Grid.Row="0" Grid.Column="3" Width="20" FontSize="14.667" Margin="0,0,3,0" />

            <TextBlock Text="Roll"           Grid.Row="1" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Roll}" Grid.Row="1" Grid.Column="1" FontSize="16" Margin="0,0,3,0" />
            <Button x:Name="RollLeft" Content="+" Click="RollLeft_Click" Grid.Row="1" Grid.Column="2" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            <Button x:Name="RollRight" Content="-" Click="RollRight_Click" Grid.Row="1" Grid.Column="3" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            
            <TextBlock Text="Altitude"           Grid.Row="2" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Altitude}" Grid.Row="2" Grid.Column="1" FontSize="16" Margin="0,0,3,0" />
            <Button x:Name="Ascend" Content="+" Click="Ascend_Click" Grid.Row="2" Grid.Column="2" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            <Button x:Name="Descend" Content="-" Click="Descend_Click" Grid.Row="2" Grid.Column="3" Width="20" FontSize="14.667" Margin="0,0,3,0" />

            <TextBlock Text="Latitude"           Grid.Row="3" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Lattitude}" Grid.Row="3" Grid.Column="1" FontSize="16" Margin="0,0,3,0" />
            <Button x:Name="SurgeFore" Content="+" Click="SurgeFore_Click" Grid.Row="3" Grid.Column="2" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            <Button x:Name="SurgeAft" Content="-" Click="SurgeAft_Click" Grid.Row="3" Grid.Column="3" Width="20" FontSize="14.667" Margin="0,0,3,0" />

            <TextBlock Text="Longitude" Grid.Row="4" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Longitude}"    Grid.Row="4" Grid.Column="1" FontSize="16" Margin="0,0,3,0" />
            <Button x:Name="SwayLeft" Content="+" Click="SwayLeft_Click" Grid.Row="4" Grid.Column="2" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            <Button x:Name="SwayRight" Content="-" Click="SwayRight_Click" Grid.Row="4" Grid.Column="3" Width="20" FontSize="14.667" Margin="0,0,3,0" />
            
            <TextBlock Text="Below" Grid.Row="5" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Below}" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3" FontSize="16" Margin="0,0,3,0" />

            <TextBlock Text="Fuel" Grid.Row="6" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Fuel}" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="3" FontSize="16" Margin="0,0,3,0" />

            <TextBlock Text="Status" Grid.Row="7" Grid.Column="0" FontSize="16" Margin="0,0,3,0" FontWeight="Bold" />
            <TextBlock Text="{Binding Status}" Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="3" FontSize="16" Margin="0,0,3,0" />
            <TextBlock Height="238" Margin="0,0,0,-246" Grid.Row="7" TextWrapping="Wrap" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="170.333" Grid.ColumnSpan="4" FontSize="13.333"><Run Text="To land the LM:"/><LineBreak/><Run Text="350 &lt; Pitch &lt; 10"/><LineBreak/><Run Text="350 &lt; Roll &lt; 10"/><LineBreak/><Run Text="Altitude = 0"/><LineBreak/><Run Text="Below = Smooth"/><LineBreak/><Run/><LineBreak/><Run Text="Run out of fuel, or get to altitude of 0 without these conditions, and you will crash the LM."/><LineBreak/><Run/><LineBreak/><Run Text="Every maneuver except descending uses fuel."/></TextBlock>
            
            <Button x:Name="StopAutopilotButton" Grid.ColumnSpan="3" Content="Stop Autopilot" Grid.Column="1" Height="24" Margin="0.834,0,0,-308.627" Grid.Row="7" VerticalAlignment="Bottom" Click="StopAutopilotButton_Click"/>
            <Button x:Name="StartAutopilotButton" Grid.ColumnSpan="3" Content="Start Autopilot" Grid.Column="1" Height="24" Margin="0.835,0,0,-280.627" Grid.Row="7" VerticalAlignment="Bottom" Click="StartAutopilotButton_Click"/>
            <Button x:Name="Restart" Content="Restart" HorizontalAlignment="Left" Height="51.667" Margin="0,0,0,126.333" VerticalAlignment="Bottom" Width="76.667" Click="Restart_Click" Grid.Row="8" />
            
            <RadioButton x:Name="BruteForceRadioButton" Content="Brute force" Margin="0,0,15,61" Grid.Row="8" VerticalAlignment="Bottom" Grid.ColumnSpan="3" IsChecked="True" Checked="BruteForceRadioButton_Checked" />
            <RadioButton x:Name="InformedRadioButton" Content="Greedy" Margin="0,0,15,39" Grid.Row="8" VerticalAlignment="Bottom" Grid.ColumnSpan="3" Checked="InformedRadioButton_Checked" />
            <TextBlock Height="21" HorizontalAlignment="Left" Margin="0,330,0,0" Name="textBlock1" Text="Find landing spot" VerticalAlignment="Top" Grid.Row="8" Grid.ColumnSpan="2" Width="120" FontWeight="Bold" />
        </Grid>
        <Canvas x:Name="HeightCanvas" Margin="252,12,87,444" Background="Black" Width="180" Height="260">
        	<Image x:Name="LanderHeightPic" Height="60" Canvas.Left="74" Source="lm.png" Stretch="Fill" Width="60" Canvas.Top="0"/>
        	<Image Height="55.333" Source="earthrise.png" Stretch="Fill" Canvas.Top="74.5" Width="64.233" Canvas.Left="8"/>
        	<Image Height="48" Source="surface.png" Stretch="Fill" Canvas.Top="212" Width="180" Panel.ZIndex="-10"/>
        </Canvas>
        <Canvas x:Name="MapCanvas" Height="300" Margin="191,0,28,35" VerticalAlignment="Bottom" Width="300" Background="Black">
        	
        	
        </Canvas>
        <TextBlock TextWrapping="Wrap" Text="Side View" VerticalAlignment="Top" Margin="255,272,90,0" HorizontalAlignment="Center"/>
        <TextBlock TextWrapping="Wrap" Text="Top View" VerticalAlignment="Bottom" RenderTransformOrigin="4.627,38.91" Margin="194,0,31,19.04" HorizontalAlignment="Center"/>
    </Grid>
</Window>
